package com.ruoyi.gpt.mapper;

import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.Constants;
import com.ruoyi.common.annotation.DataColumn;
import com.ruoyi.common.annotation.DataPermission;
import com.ruoyi.gpt.domain.ChatToken;
import com.ruoyi.gpt.domain.vo.ChatTokenVo;
import com.ruoyi.common.core.mapper.BaseMapperPlus;
import com.ruoyi.mall.domain.Address;
import org.apache.ibatis.annotations.Param;

import java.util.Collection;

/**
 * chatGpt的tokenMapper接口
 *
 * @author ztx
 * @date 2023-03-17
 */
public interface ChatTokenMapper extends BaseMapperPlus<ChatTokenMapper, ChatToken, ChatTokenVo> {
    @Override
    @DataPermission({
        @DataColumn(key = "deptName", value = "dept_id"),
        @DataColumn(key = "userName", value = "user_id"),
        @DataColumn(key = "appid", value = "appid")
    })
    <P extends IPage<ChatToken>> P selectPage(P page, @Param(Constants.WRAPPER) Wrapper<ChatToken> queryWrapper);
    @Override
    @DataPermission({
        @DataColumn(key = "deptName", value = "dept_id"),
        @DataColumn(key = "userName", value = "user_id")
    })
    int updateById(@Param(Constants.ENTITY) ChatToken entity);

    @Override
    @DataPermission({
        @DataColumn(key = "deptName", value = "dept_id"),
        @DataColumn(key = "userName", value = "user_id")
    })
    int deleteBatchIds(@Param(Constants.COLL) Collection<?> idList);
}
